<script src="../ueditor.parse.js" type="text/javascript"></script>
<script>
    uParse('.content',{
        'rootPath': '../'
    })

</script>

<?php
require_once "config.php";
$title = $_POST['title'];
$author = $_POST['author'];
$keywords = $_POST['keywords'];
$content = getContent($_POST['content']);
$cateid = $_POST['level'];
$time = time();
if($title!=""&&$author!=""&&$keywords!=""&&$content!=""){
    $sql = "insert into article(title,author,keywords,content,cateid,time) value('{$title}','{$author}','{$keywords}','{$content}',{$cateid},{$time})";
    $rst = mysqli_query($con,$sql);
    $id = mysqli_insert_id($con);
    if($id){
        echo "<script>alert('添加成功!');window.location.href='article_list.php';</script>";
    }else{
        echo "<script>alert('添加失败,请重新输入');window.location.href='article_add.php';</script>";
    }
}else{
    echo "<script>alert('不能为空,请重新输入');window.location.href='article_add.php';</script>";
}